<template>
  <div style="background-color: #f7f7f7">
    <demandForm @submit="submit"></demandForm>
  </div>
</template>

<script>
import { addDemand } from '@/api/demand.js'
import demandForm from '@/components/DemandForm.vue'
export default {
  name: "DemandPublish",
  components: {
    demandForm
  },
  data(){
    return {

    }
  },
  methods:{
    submit(form){
      addDemand(form).then(res => {
            this.$modal.msgSuccess("发布成功，请等待审核");
            setTimeout(() => {
              this.$router.replace('/index')
            }, 800);
          })
    }
  }
};
</script>

<style lang="scss" scoped>
.register-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 1200px;
  background: #ffffff;
  border-radius: 0px;
  padding: 60px 0;
  margin: 0 auto 30px;
}

</style>
